<template>
  <div class="list-wraper">
    <wh-flow-list
      :base-url="baseUrl"
      :headers="headers"
      @on-click-command="handleClickCommand" />
  </div>
</template>

<script>
import { whFlowList } from 'wh-flow'
// import { whFlowList } from '@/components/whFlow/index'
export default {
  components: {
    whFlowList
  },
  data() {
    return {
      baseUrl: 'http://192.168.20.13:8083',
      headers: {
        Authorization: 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjFmZGYzMmJmLWQ2MzItNDM2Yi1iYzY0LTQ4ZmEzM2JhYmJhNCJ9.bex9Jly6LmjqfFV73h3o08lUlhnmJ_kmSC78DdJTQRmED2OkYU22SvWidSwSbo9Vn5olK_k7sjdwO46wZ0k7yA',
      },
    }
  },
  created() {
  },
  methods: {
    handleClickCommand (data) {
      if (data.id) {
        this.$router.push({
          path: data.type === 'look'?'/wh-flow-display':'/wh-flow-index',
          query: {
            id: data.id,
            disabled: data.disabled || 0
          }
        })
      } else {
        this.$router.push({
          path: '/wh-flow-index'
        })
      }

    }
  },
}
</script>

<style scoped lang="scss">
  .list-wraper {
    width: 100%;
    height: 100%;
    padding: 16px;
    box-sizing: border-box;
  }
</style>
